package com.zhangtai.modules.service.system;

import com.alibaba.fastjson.JSONObject;
import com.zhangtai.modules.entity.system.UserRoleEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;


/**
 * 用户与角色对应关系
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-08-10 10:53:32
 */

public interface UserRoleService {

    @GetMapping("/findUserRoleList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @ApiOperation(value = "原生分页查询")
    PageResult<JSONObject> queryPageList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);
   
    @GetMapping("/infoUserRole")
    @ApiOperation(value = "根据id查找")
        UserRoleEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveUserRole")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody UserRoleEntity entity);

    @PostMapping("/updateUserRole")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody UserRoleEntity entity);

    @GetMapping("/deleteOneUserRole")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteUserRoles")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

